<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>系统常态化运行评分系统</title>
    <link rel="stylesheet" href="../component/pear/css/pear.css" />
    <style>
        .text-container {
            overflow: hidden;
            max-height: 4.5em;
            /* 初始显示的行数，可以根据需要调整 */
            position: relative;
            line-height: 1.5em;
        }

        .text-container.expanded {
            max-height: none;
            /* 扩展时的最大高度，以显示所有文本 */
        }

        .toggle-button {
            position: absolute;
            bottom: 0;
            right: 0;
            background-color: #fff;
            cursor: pointer;
            color: #007BFF;
        }
    </style>
    <script>
        function toggleText() {
            var textContainer = document.querySelector('.text-container');
            textContainer.classList.toggle('expanded');
            let classVal = $("#div-text-container").attr('class');
            if (classVal.indexOf('expanded') != -1) {
                $('#div-toggle-button').html('收缩')
            } else {
                $('#div-toggle-button').html('展开')
            }
        }
    </script>
</head>

<body class="pear-container">
    <div class="layui-card">
        <div class="layui-card-header" id="divHeader">
            韩家湾煤矿基本信息
        </div>
        <div class="layui-card-body">
            <form class="layui-form" action="" onsubmit="return false" lay-filter="lay-info">
                <div class="layui-card">
                    <div class="layui-card-body">
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="font-weight: 600;">矿井名称：</label>
                            <div class="layui-input-block">
                                <select name="mineName" id="mineName" lay-verify="required" lay-search="" lay-filter="mineName" lay-reqtext="请选择矿井名称"> 
                                    <option value="7001" selected>韩家湾</option>
                                    <option value="7002">孙家岔</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-tab layui-tab-brief" lay-filter="tab-handle">
                            <ul class="layui-tab-title">
                                <li class="layui-this" lay-id="11">评分记录</li>
                                <li lay-id="33">矿井资料</li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <iframe  id="ListIframe" src="" frameborder="0" style="width:100%; height:600px;"></iframe>
                                </div>
                                <div class="layui-tab-item">
                                    <iframe  id="areaFileIframe" src="" frameborder="0" style="width:100%; height:350px;"></iframe>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>

    <script type="text/html" id="user-bar">
  {{# if(localStorage.getItem("roleType")==2){ }}
  {{# if (d.total === d.commitZpTotal) { }}
      <button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" title="去评分" lay-event="pf"><i
      class="layui-icon layui-icon-key">去评分</i></button>
  {{# } }}
  {{# } else { }}
      <button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" title="查看评分详情" lay-event="pf"><i
      class="layui-icon layui-icon-search">详情</i></button>
  {{# } }}

  {{# if (d.commitZpTotal>0 ) { }}
      <button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" title="查看报告"  lay-event="getReports"><i
      class="layui-icon layui-icon-file-b">看报告</i></button>
  {{# } }}
  {{# if (d.total === d.commitZpTotal && d.total === d.commitCheckTotal  ) { }}
  <button class="pear-btn pear-btn-primary pear-border-blue pear-btn-xs" title="下载报告"  lay-event="downloadReports"><i
      class="layui-icon layui-icon-download-circle">下载报告</i></button>
  {{# } }}
</script>


    <script src="../component/layui/layui.js"></script>
    <script src="../component/pear/pear.js"></script>
    <script src="../scripts/utils/auth.js"></script>
    <script src="../scripts/utils/request.js"></script>
    <script src="../scripts/echart/pfechart.js"></script>
    <script>
        var $, form, popup, notice, table,mineid
        layui.use(['form', 'table', 'jquery', 'popup', 'notice', 'echarts', 'element'], function () {
            form = layui.form;
            $ = layui.jquery;
            popup = layui.popup;
            notice = layui.notice;
            table = layui.table;
            var echarts = layui.echarts;
            element = layui.element;

            var id = $('#mineName').val();

            layui.form.on('select(mineName)', function(data){
                initData(data.value)
              });
            initData(id);
            function initData(id){
                //请求接口获取个人基本信息（主要是根据需要获取评分密码）
                let reqData = { "id": id }
                postAjaxNoSuccessTip('/api/mine/getMineById', reqData, function (response) {
                    $('#divRemark').html(response.data.remark)
                    $('#divHeader').html(response.data.mineName + '基本信息');
                }, null);
                //去获取评分记录
                // loadPfList();
                $('#ListIframe').attr('src', './pflistmine.html?id=' + id);
                element.on('tab(tab-handle)', function (data) {
                    if (data.index == 0) {
                        // loadPf();
                    }else if(data.index == 1){
                        //加载矿井资料
                        $('#areaFileIframe').attr('src', './area/areaFileList.html?mineId=' + id);
                    
                    }
                });
            }
  
        });
    </script>
</body>

</html>